﻿using System;
using System.Collections.Generic;

namespace Devv.FreshTracker
{
	public class DoubleItem
	{
		#region Properties

		public Double Value { get; set; }
		public String Key { get; set; }
		
		#endregion

		#region Constructor

		public DoubleItem()
		{
		}

		public DoubleItem(Double value, String key)
		{
			Key = key;
			Value = value;
		}

		#endregion

		#region Find

		public static DoubleItem FindInList(List<DoubleItem> list, Double value)
		{
			foreach (DoubleItem item in list)
			{
				if (item.Value == value)
				{
					return item;
				}
			}

			return null;
		}

		#endregion
	}
}